class Solution:
    def isPowerOfFour(self, num: int) -> bool:
        num_str = bin(num)[2:]
        if num_str.startswith("1") and num_str.count("0") % 2 == 0 and num_str.count("1") == 1:
            return True
        return False


class Solution2:
    def isPowerOfFour(self, num: int) -> bool:
        """考虑一下可以用二进制做"""
        pass


a = Solution()
print(a.isPowerOfFour(16))
print(a.isPowerOfFour(5))
